package com.baidu.controller;

import java.util.List;
import java.util.Map;

import com.baidu.emus.CloudType;
import com.baidu.emus.EnumBean;
import com.baidu.emus.EnumRepository;
import com.baidu.interceptor.LoginInterceptor;
import com.baidu.interceptor.MainInterceptor;
import com.baidu.model.CloudCount;
import com.jfinal.aop.Clear;
import com.jfinal.core.Controller;

public class IndexController extends Controller {

	public void index(){
		this.setAttr("cloud", CloudCount.dao.findCountByType(CloudType.signCount.getCode(),0L,0L));
		render("user/index.html");
	}
	
	@Clear({MainInterceptor.class,LoginInterceptor.class})
	public void install(){
		render("install/install.html");
	}
	
	/**
	 * 加载枚举类js
	 */
	public void enum_js() {
		this.getResponse().setContentType("text/javascript;charset=UTF-8");
		Map<String, List<EnumBean>>  repository =  EnumRepository.getRepository();
		this.setAttr("repository", repository);
		this.render("enum_js.html");
	}

}
